home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
By the Book
/
Learn C++ (CodeWarrior)
/
Chap 09.03 - nonVirtual
/
nonVirtual.cp
< prev
next >
Wrap
Text File
|
1995-10-21
|
778b
|
67 lines
#include <iostream.h>
//--------------------------------------- Root
class Root
{
public:
Root();
};
Root::Root()
{
cout << "Root constructor called\n";
}
//--------------------------------------- Base1
class Base1 : public Root
{
public:
Base1();
};
Base1::Base1()
{
cout << "Base1 constructor called\n";
}
//--------------------------------------- Base2
class Base2 : public Root
{
public:
Base2();
};
Base2::Base2()
{
cout << "Base2 constructor called\n";
}
//--------------------------------------- Derived
class Derived : public Base1, public Base2
{
public:
Derived();
};
Derived::Derived()
{
cout << "Derived constructor called\n";
}
//--------------------------------------- main()
int main()
{
Derived myDerived;
return 0;
}